/* 
  该文件专门为Count组件生成action对象
*/



export const createIncrementAction = data => ({type: 'increment', data})
export const createDecrementAction = data => ({type: 'decrement', data})

// 异步action就是指action的值为函数,异步action中一般会调用同步action 
export const createIncrementAsyncAction = (data, time) => {
  return (dispatch)=>{
    setTimeout(()=>{
      dispatch(createIncrementAction(data))
    },time)
  }
}